package l1j.opqlo.NewSystem.鑑定系統;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class L1IdStatus {
	private static final Logger _log = Logger.getLogger(L1IdStatus.class.getName());
	private int _statusCount, _chance;

	private boolean _isRandom , _canRestore;

	private final HashMap<Integer, int[]> _StatusList = new HashMap<Integer, int[]>();
	private final List<Integer> _TypeList = new ArrayList<Integer>();
	private int[] _totalType;

	public int getChance() {
		return this._chance;
	}

	public int getStatusCount() {
		return this._statusCount;
	}

	// public L1IdStatus (
	/*
	 * public void set( String normal , //對普通種族增傷 String undead , //對不死增傷 String
	 * diablo , //對惡魔增傷 String boss , //對頭目增傷 String ghost , //對亡靈增傷 String wolf
	 * ,//對狼族增傷 String dragon,//對龍族增傷 String mr ,//魔防 String extraDmg ,//破甲
	 * String extraDef ,//抵擋 String eathMr ,//地防 String fireMr ,//火防 String
	 * waterMr ,//水防 String windMr ,//風防 String earthDmg ,//地攻 String fireDmg
	 * ,//火攻 String waterDmg ,//水攻 String windDmg ,//風攻 String str ,//力量 String
	 * dex ,//敏捷 String Int ,//智慧 String wis ,//精神 String con ,//體質 String cha ,
	 * //魅力 String hp , //血量 String hpr , //回血 String mp , //魔量 String mpr ,
	 * //回魔 String hit , //命中 String Dmg , //額外攻擊 String exp , //經驗加倍 String
	 * DmgX2 ,//爆擊 String big ,//對大怪增傷 String small , ///對小怪增傷
	 *
	 * String sturnDice , //暈眩增加(機率) String stoneDice , //石化增加(機率) String
	 * sleepDice , //睡眠增加(機率) String freezeDice , //凍結增加(機率) String sustainDice
	 * , //支撐增加(機率) String blindDice , //暗黑增加(機率)
	 *
	 * String sturnDef,//暈眩增加(抗性) String stoneDef,//石化增加(抗性) String
	 * sleepDef,//睡眠增加(抗性) String FerrzeDef,//凍結增加(抗性) String
	 * sustainDef,//支撐增加(抗性) String blindDef//暗黑增加(抗性) ){
	 *
	 * System.out.println("START"); stringToInt( str );
	 * System.out.println("PASS"); stringToInt( dex ); stringToInt( Int );
	 * stringToInt( wis ); stringToInt( con ); stringToInt( cha );
	 *
	 * stringToInt( eathMr ); stringToInt( fireMr ); stringToInt( waterMr );
	 * stringToInt( windMr );
	 *
	 * stringToInt( earthDmg ); stringToInt( fireDmg ); stringToInt( waterDmg );
	 * stringToInt( windDmg );
	 *
	 *
	 * stringToInt( mr ); stringToInt( extraDmg ); stringToInt( extraDef );
	 * stringToInt( hp ); stringToInt( hpr ); stringToInt( mp ); stringToInt(
	 * mpr ); stringToInt( hit ); stringToInt( Dmg ); stringToInt( exp );
	 * stringToInt( DmgX2 ); stringToInt( big ); stringToInt( small );
	 *
	 *
	 * stringToInt( sturnDice ); stringToInt( stoneDice ); stringToInt(
	 * sleepDice ); stringToInt( freezeDice ); stringToInt( sustainDice );
	 * stringToInt( blindDice );
	 *
	 * stringToInt( sturnDef ); stringToInt( stoneDef ); stringToInt( sleepDef
	 * ); stringToInt( FerrzeDef ); stringToInt( sustainDef ); stringToInt(
	 * blindDef );
	 *
	 *
	 * stringToInt( normal ); stringToInt( undead ); stringToInt( diablo );
	 * stringToInt( boss ); stringToInt( ghost ); stringToInt( wolf );
	 * stringToInt( dragon );
	 *
	 *
	 * }
	 */

	public int[] getStatusValue(final int type) {

		return this._StatusList.get(type);
	}

	public int[] getTotalType() {
		return this._totalType;
	}

	public boolean isRandom() {
		return this._isRandom;
	}

	public void setChance(final int i) {
		this._chance = i;
	}

	public void setisRandom(final boolean i) {
		this._isRandom = i;
	}
	/**設定是否可將鑑定還原*/
	public void setCanRestory(final boolean b){
		_canRestore = b;
	}
	/**傳回是否可將鑑定還原*/
	public boolean canRestore(){
		return _canRestore;
	}
	
	
	

	// private int[] _normal , _undead , _diablo , _boss , _ghost , _wolf ,
	// _dragon ,_mr , extraDmg , extraDef ,eathMr , fireMr , waterMr , windMr ,
	// _earthDmg , _fireDmg , _waterDmg , _windDmg, _str , _dex , _int , _wis ,
	// _con , _cha;
	public void setStatusCount(final int i) {
		this._statusCount = i;
	}

	public void setTotalType() {
		try{
			if (this._TypeList.isEmpty()) {
				return;
			}
			final int size = this._TypeList.size();
			this._totalType = new int[size];
			for (int i = 0; i < size; i++) {
				this._totalType[i] = this._TypeList.get(i);
			}
		}catch(Exception e){
			_log.log(Level.SEVERE , e.getLocalizedMessage() , e);
		}
	}

	public void stringToInt(final int type, final int[] value) {
		try{
			if (value == null) {
				return;
			}

			if (value[0] != 0) {
				this._StatusList.put(new Integer(type), value);
				this._TypeList.add(type);
			}/*
			 *
			 * final StringTokenizer st = new StringTokenizer(s, ":");
			 *
			 * final int iSize = st.countTokens();
			 *
			 * String sTemp = null;
			 *
			 * final int[] iReturn = new int[iSize];
			 *
			 * _type++;
			 *
			 * for (int i = 0; i <= iSize; i++) { sTemp = st.nextToken(); iReturn[i]
			 * = Integer.parseInt(sTemp); } if(iReturn[0] !=0){ _StatusList.put(new
			 * Integer(_type), iReturn); _TypeList.add(_type); }
			 *
			 * /*if( iReturn[0] >0){ return iReturn; }
			 */
		}catch(Exception e){
			_log.log(Level.SEVERE , e.getLocalizedMessage() , e);
		}
	}

}
